<%= stylesheet_link_tag "components/_footer" %>

<script type="text/javascript" charset="utf-8">
    var footer;
    $(function () {
        footer = root.getWidgetById("footer");

        footer.on("keydown", function (e) {
            e = e || window.event;
            var keyValue = e.which || e.keyCode;
            if (keyValue === 13) {
                window.location.href = e.target.con.dataset.href;
            }
        });

        <% if ENV['ON_PC'] %>
        // 点击跳转
        footer.on("click", function (e) {
            window.location.href = e.target.con.dataset.href;
        });
        <% end %>
    });
</script>

<div id="footer" fe-role="Switch" fe-cfg="default_focus:yes,">
  <div class="user-box">
    <%= image_tag "icons/person.png" %>
  </div>

  <div id="footer-placeholder" class="navigation-list">

    <% footer_navigation.each do |item| %>
      <div data-href="<%= item[:path] %>"
           id="footer-<%= item[:id] %>"
           class="navigation-item"
           <%= "fe-role=Widget" if item[:path] %>
           <%= "fe-cfg=default_focus:yes" if is_matched_route?(item[:path]) %>
      >
        <%= item[:name] %>
      </div>
    <% end %>

  </div>
</div>
